<h:panelGrid xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:t="http://myfaces.apache.org/tomahawk" width="100%"
	id="qtnirePanelGrid">
	<t:saveState value="#{evokPatientQtnaireBean.patientTherapy}" />
	<t:saveState value="#{evokPatientQtnaireBean.patientQtnaire}" />
	<t:saveState value="#{evokPatientQtnaireBean.questions}" />
	<h:inputHidden value="#{evokPatientQtnaireBean.patientTherapy.id}" />
	<p:accordionPanel activeIndex="#{evokPatientQtnaireBean.tabIndex}">
		<p:tab title="#{msgs.patient_qtnaire_list_title}">
			<p:dataTable var="pq" id="patientQtnairelist" rowIndexVar="ri"
				emptyMessage=""
				value="#{evokPatientQtnaireBean.patientQtnaireModel}"
				selectionMode="single" widgetVar="wdgPatientQtnaireList"
				rowKey="#{pq.id}">

				<p:column styleClass="width5">
					<f:facet name="header">
						<h:outputText value="#{msgs.table_index}" />
					</f:facet>
					<h:outputText value="#{ri+1}" />
				</p:column>

				<p:column headerText="#{msgs.default_create_time}">
					<h:outputText value="#{pq.createTime}">
						<f:convertDateTime pattern="dd/MM/yyyy HH:mm" />
					</h:outputText>
				</p:column>

				<p:column headerText="#{msgs.default_name}">
					<h:outputText value="#{pq.qtnaire.name}" />
				</p:column>

				<p:column styleClass="width5">
					<f:facet name="header">
						<t:outputText value="#{msgs.table_column_operation}" />
					</f:facet>
					<h:panelGrid columns="2" styleClass="gridNoBorder">
						<p:commandLink oncomplete="qtnaireDialog.show()"
							update=":dialogform:qtnairePanelGroup"
							styleClass="ui-icon ui-icon-pencil" title="#{msgs.button_edit}"
							type="image" actionListener="#{evokPatientQtnaireBean.editAction}">
							<f:setPropertyActionListener value="#{pq}"
								target="#{evokPatientQtnaireBean.patientQtnaire}" />
						</p:commandLink>
						<p:commandLink oncomplete="confirmQtnaireDelete.show()"
							styleClass="ui-icon ui-icon-trash" title="#{msgs.button_delete}"
							actionListener="#{evokPatientQtnaireBean.deleteListenerAction}"
							type="image">
							<f:setPropertyActionListener value="#{pq}"
								target="#{evokPatientQtnaireBean.patientQtnaire}" />
						</p:commandLink>
					</h:panelGrid>
				</p:column>
			</p:dataTable>
		</p:tab>
		<p:tab title="#{msgs.patient_qtnaire_add_title}">
			<p:tree value="#{evokPatientQtnaireBean.rootQtnaire}" var="node"
				selection="#{evokPatientQtnaireBean.selectedNode}"
				selectionMode="single" style="background:none; width:90%;">
				<p:treeNode>
					<h:outputText value="#{node.name}" styleClass="tree_font" />
				</p:treeNode>
			</p:tree>
			<p:commandButton update=":dialogform:qtnairePanelGroup"
				id="addQtnaireButton"
				actionListener="#{evokPatientQtnaireBean.qtnaireAddAction}"
				oncomplete="qtnaireDialog.show();" icon="ui-icon-plus"
				value="#{msgs.button_add}" style="float:right;">
			</p:commandButton>
		</p:tab>
	</p:accordionPanel>
</h:panelGrid>
